<?php

use Illuminate\Database\Migrations\Migration;
use Illuminate\Database\Schema\Blueprint;
use Jialeo\LaravelSchemaExtend\Schema;

class CreateCollegeTrainingOrdersTable extends Migration
{
    /**
     * Run the migrations.
     *
     * @return void
     */
    public function up()
    {
        Schema::create('college_training_orders', function (Blueprint $table) {
            $table->id();
            $table->char('orderNo', 20)->default('')->comment('培训单号');
            $table->unsignedInteger('planId')->default(0)->comment('培训计划id');
            $table->unsignedInteger('studentShopId')->default(0)->comment('参训门店id');
            $table->unsignedInteger('actualNum')->default(0)->comment('实际参与人数');
            $table->unsignedInteger('planNum')->default(0)->comment('计划参与人数');
            $table->unsignedInteger('status')->default(0)->comment('1商家待确认 2商学院待确认 3进行中 4待阅卷 5已完成 6已关闭');

            $table->unsignedInteger('createdAt')->default(0)->comment('创建时间');
            $table->unsignedInteger('createdByUid')->default(0)->comment('创建人');
            $table->unsignedInteger('updatedAt')->default(0)->comment('修改时间');
            $table->unsignedInteger('updatedByUid')->default(0)->comment('修改人');
            $table->collation = 'utf8mb4_general_ci';
            $table->comment = '商学院 - 培训订单';
        });
    }

    /**
     * Reverse the migrations.
     *
     * @return void
     */
    public function down()
    {
        Schema::dropIfExists('college_training_orders');
    }
}
